home *** CD-ROM | disk | FTP | other *** search
- on goToQuiz whichBtn
- global gBridgeParts,gAnswered,gCat,gWhichBridge,gCatTitle
- set gBridgeParts = 0
- -- set gBridgeParts = 9
- set gAnswered = 0
- repeat while gWhichBridge = VOID
- set whichBridge = random(10)
- if count(gBridgeLst) <> 10 and count(gBridgeLst) <> 0 then
- if getPos(gBridgeLst,whichBridge) = 0 then
- set gWhichBridge = whichBridge
- end if
- else
- set gWhichBridge = whichBridge
- end if
- end repeat
- set gCatTitle = word 1 of the name of member the memberNum of sprite whichBtn of castLib "chooser"
- set gCat = word 1 of the name of member the memberNum of sprite whichBtn of castLib "chooser"
- InitializeTracking gCat
- clearSndList
- clearAnimaList
- go to frame "quiz"
- doMusicBtn
- putUpQuestion
- end goToQuiz
-
-
- on putUpQuestion
- global gLangSelect,gWhichQuest,gLangName,gQuestion,gAnswer,gCat,gLangDirect,gAnsSndLst,gAnswered,gStampSpt,gQuestSndLst, gCatTitle
- set the visible of sprite 1 to 0
- set the visible of sprite 1 to 1
- updateStage
- set gAnswered = 0
- set tempLst = []
- set gAnsSndLst = []
- set gQuestSndLst = []
- if gCatTitle = "allw" or gCatTitle = "all" then
- findgCat
- end if
- chooseQuestionNum
- if gLangDirect = 1 then
- set gQuestSndLst = askQuestionInEnglish (tempLst)
- makeEnglishAnswerLst
- else
- set gQuestSndLst = askForeignQuestion (tempLst)
- makeForiegnAnswerLst
- end if
- -- laying out text
- set text = gQuestion
- set letterLst = []
- setBoxSize "questBox"
- set letterLst = countAndCenterText (text, "whi", "center")
- stampOutTxt letterLst, gStampSpt, "1"
- -- put gQuestion into field "text Display"
- -- laying out answers
- repeat with x = 1 to 4
- set text = getAt(gAnswerLst,x)
- set letterLst = []
- setBoxSize ("ans"&x)
- set letterLst = countAndCenterText (text, "whi", "center")
- stampOutTxt letterLst, gStampSpt, "1"
- -- put text into field (x&&"answer")
- end repeat
- set the itemDelimiter to ","
- repeat with x = 1 to count(gAnsSndLst)
- add(tempLst,getAT(gAnsSndLst,x))
- end repeat
- startSndList gQuestSndLst
- end putUpQuestion
-
-
- on askQuestionInEnglish sndLst
- global gLangSelect,gWhichQuest,gLangName,gQuestion,gAnswer,gCat, gLangDirect, gQuestSndLst,gSndPath,gFileDelimiter, gAnsSndLst,gCatTitle
- set the itemDelimiter to "*"
- -- set gCat = "tphr"
- -- set gWhichQuest = 109
- -- if gCatTitle = "allw" or gCatTitle = "all" then
- -- findgCat
- -- end if
- set aWord = item 2 of line gWhichQuest of field ("e "&gCat)
- set gAnswer = item 3 of line gWhichQuest of field (gLangSelect&&gCat) of castLib (gLangSelect&"Cst")
- set gQuestion = ("What is "&gLangName&" for "&line 1 of field "quote"&aWord&line 1 of field "quote"&"?")
- set engPath = (gSndPath&"e"&gFileDelimiter)
- add(sndLst,(engPath&"eQuest"&gLangSelect&".aif"))
- -- add(sndLst,(engPath&gCat&gFileDelimiter&gCat&gWhichQuest&".aif"))
- -- these are the ones that reference the language
- if gCat = "tphr" and gWhichQuest = 109 then -- if you're in the right category
- set aSent = ("How do you say 'notebook' in "&gLangName&"?")
- set gQuestion = ("What is "&gLangName&" for "&line 1 of field "quote"&aSent&line 1 of field "quote"&"?")
- add(sndLst,(gSndPath&"e"&gFileDelimiter&gCat&gFileDelimiter&gLangSelect&gCat&gWhichQuest&".aif"))
- add(gAnsSndLst,(gSndPath&gLangSelect&gFileDelimiter&gCat&gFileDelimiter&gCat&gWhichQuest&".aif"))
- else if gCat = "tphr" and gWhichQuest = 7 then -- if you're one of these two nubmers
- set aSent = ("My "&gLangName&" is not very good.")
- set gQuestion = ("What is "&gLangName&" for "&line 1 of field "quote"&aSent&line 1 of field "quote"&"?")
- add(sndLst,(gSndPath&"e"&gFileDelimiter&gCat&gFileDelimiter&gLangSelect&gCat&gWhichQuest&".aif"))
- add(gAnsSndLst,(gSndPath&gLangSelect&gFileDelimiter&gCat&gFileDelimiter&gCat&gWhichQuest&".aif"))
- else
- add(sndLst,(engPath&gCat&gFileDelimiter&gCat&gWhichQuest&".aif"))
- add(gAnsSndLst,(gSndPath&gLangSelect&gFileDelimiter&gCat&gFileDelimiter&gCat&gWhichQuest&".aif"))
- end if
- return sndLst
- end askQuestionInEnglish
-
- on makeEnglishAnswerLst
- global gAnswerLst,gAnswer,gLangName, gLangSelect,gCat,gAnsSndLst,gSndPath,gFileDelimiter
- set gAnswerLst = []
- add(gAnswerLst, gAnswer)
- set langPath = (gSndPath&gLangSelect&gFileDelimiter)
- set the itemdelimiter = "*"
- repeat while count(gAnswerLst) < 4
- set whichField = (gLangSelect&&gCat) -- taking other words of same language
- set whichLine = random(the number of lines in field whichField)
- set aLine = line whichLine of field whichField
- set aAnswer = item 3 of aLine
- if aAnswer = "" then
- beep
- end if
- if getPos(gAnswerLst, aAnswer) = 0 then
- add(gAnswerLst,aAnswer)
- add(gAnsSndLst,(langPath&gCat&gFileDelimiter&gCat&whichLine&".aif"))
- end if
- end repeat
- set the itemdelimiter = ","
- mixUpAnswerLst
- end makeEnglishAnswerLst
-
- on askForeignQuestion sndLst
- global gLangSelect,gWhichQuest,gLangName,gQuestion,gAnswer,gCat, gLangDirect,gFileDelimiter,gSndPath,gAnsSndLst,gCatTitle
- -- if gCatTitle = "allw" or gCatTitle = "all" then
- -- findgCat
- -- end if
- -- set gCat = "tphr"
- -- set gWhichQuest = 109
- set the itemDelimiter to "*"
- set aWord = item 3 of line gWhichQuest of field (gLangSelect&&gCat) of castLib (gLangSelect&"Cst")
- if gLangSelect = "f" then
- set gQuestion = ("Comment dit-on "&line 1 of field "quote"&aWord&line 1 of field "quote"&" en anglais?")
- else if gLangSelect = "s" then
- set gQuestion = ("¿Cómo se dice "&line 1 of field "quote"&aWord&line 1 of field "quote"&" en inglés?")
- else if gLangSelect = "I" then
- set gQuestion = ("Cos'è l'inglese per "&line 1 of field "quote"&aWord&line 1 of field "quote"&"?")
- else if gLangSelect = "g" then
- set gQuestion = ("Was ist "&line 1 of field "quote"&aWord&line 1 of field "quote"&" auf englisch?")
- end if
- set engPath = (gSndPath&gLangSelect&gFileDelimiter)
- add(sndLst,(engPath&gLangSelect&"quest.aif"))
- add(sndLst,(engPath&gCat&gFileDelimiter&gCat&gWhichQuest&".aif"))
- if gLangSelect = "g" or gLangSelect = "f" or gLangSelect = "s" then
- add(sndLst,(engPath&gLangSelect&"quest2.aif"))
- end if
-
- if gCat = "tphr" and gWhichQuest = 109 then
- set gAnswer = ("How do you say 'notebook' in "&gLangName&"?")
- add(gAnsSndLst,(gSndPath&"e"&gFileDelimiter&gCat&gFileDelimiter&gLangSelect&gCat&gWhichQuest&".aif"))
- else if gCat = "tphr" and gWhichQuest = 7 then
- set gAnswer = ("My "&gLangName&" is not very good.")
- add(gAnsSndLst,(gSndPath&"e"&gFileDelimiter&gCat&gFileDelimiter&gLangSelect&gCat&gWhichQuest&".aif"))
- else
- set gAnswer = item 2 of line gWhichQuest of field ("e "&gCat)
- add(gAnsSndLst,(gSndPath&"e"&gFileDelimiter&gCat&gFileDelimiter&gCat&gWhichQuest&".aif"))
- end if
- return sndLst
- end askForeignQuestion
-
-
- on makeForiegnAnswerLst
- global gAnswerLst,gAnswer,gLangName, gLangSelect,gCat
- global gSndPath,gFileDelimiter,gCat,gFileDelimiter,gAnsSndLst
- set gAnswerLst = []
- add(gAnswerLst, gAnswer)
- set langPath = (gSndPath&"e"&gFileDelimiter)
- set the itemdelimiter = "*"
- repeat while count(gAnswerLst) < 4
- set whichField = ("e"&&gCat) -- taking other words of same language
- set whichLine = random(the number of lines in field whichField)
- set aLine = line whichLine of field whichField
- set aAnswer = item 2 of aLine
- if getPos(gAnswerLst, aAnswer) = 0 then
- add(gAnswerLst,aAnswer)
- add(gAnsSndLst,(langPath&gCat&gFileDelimiter&gCat&whichLine&".aif"))
- end if
- end repeat
- set the itemdelimiter = ","
- mixUpAnswerLst
- end makeForiegnAnswerLst
-
-
- on mixUpAnswerLst
- global gAnswerLst, gAnswerSpt,gAnswer,gAnsSndLst,gSndPath
- set tempLst = []
- set tempSndLst = []
- repeat while count(tempLst) < 4
- set aAnswer = random(count(gAnswerLst))
- add(tempLst,getAT(gAnswerLst,aAnswer))
- add(tempSndLst,getAT(gAnsSndLst,aAnswer))
- if getAT(gAnswerLst,aAnswer) = gAnswer then
- set gAnswerSpt = count(tempLst)
- end if
- deleteAt(gAnswerLst,aAnswer)
- deleteAt(gAnsSndLst,aAnswer)
- end repeat
- set gAnswerLst = tempLst
- -- set gAnsSndLst = tempSndLst
- set gAnsSndLst = []
- repeat with x = 1 to count(tempSndLst)
- add(gAnsSndLst,getAt(tempSndLst,x))
- add(gAnsSndLst,(gSndPath&"noSnd.aif"))
- end repeat
- end mixUpAnswerLst
-
- on enterAnswer whichBtn
- global gAnswerRight,gAnswerSpt,gAnswered,gAnswerLinesBox,gfstLftArr,gLstRtArr,gClickNote,gBridgeMonitor, gBridgeParts, gRightTag, gStampSpt, gEyeSprite,gSwitchSpt,gLangDirect,gLangSelect
- if gAnswered <> 1 then
- set gAnswered = 1
- set the membernum of sprite gAnswerLinesBox to the number of member "answerarea gray" -- gray out answer fields
- -- gray out arrows
- repeat with x = gfstLftArr to gLstRtArr
- if x <> gfstLftArr + 1 and x <> gfstLftArr + 4 and x <> gfstLftArr + 7 and x <> gfstLftArr + 10 then
- put the name of member the memberNum of sprite x of castLib "quiz" into foo
- put "gray" into word (the number of words in foo) of foo
- set the memberNum of sprite x to the number of member foo
- end if
- end repeat
- set the memberNum of sprite gEyeSprite to the number of member ("eye gray")
- set the memberNum of sprite gSwitchSpt to the number of member ("switch gray")
- -- click to continue
- if gLangDirect = 1 then
- set the membernum of sprite gClickNote to the number of member "e click up"
- else
- set the membernum of sprite gClickNote to the number of member (gLangSelect&" click up")
- end if
- -- stop talking/idling
- clearSndList
- -- clearAnimalist
- -- figuring right or wrong
- put the name of member the memberNum of sprite whichBtn of castLib "quiz" into foo
- set foo = value(word 1 of foo)
-
- -- re-write answers: right in green, wrong in red, others in another color
- repeat with x = 1 to 4
- set text = getAt(gAnswerLst,x)
- set letterLst = []
- setBoxSize ("ans"&x)
- if x = gAnswerSpt then
- set whichColor = "grn"
- else if x = foo and foo <> gAnswerSpt then
- set whichColor = "red"
- else
- set whichColor = "whi"
- end if
- set letterLst = countAndCenterText (text, whichColor, "center")
- stampOutTxt letterLst, gStampSpt, "1"
- -- put text into field (x&&"answer")
- end repeat
- if gAnswerSpt = foo then
- set gAnswerRight = 1
- -- bridge
- set gBridgeParts = gBridgeParts + 1
- set the membernum of sprite gBridgeMonitor to the number of member ("bridge "&gBridgeParts)
- if gLangDirect = 1 then
- set the membernum of sprite gRightTag to the number of member "e correct"-- correct/incorrect
- else
- set the membernum of sprite gRightTag to the number of member (gLangSelect&" correct")
- end if
- else
- if gLangDirect = 1 then
- set the membernum of sprite gRightTag to the number of member "e incorrect"-- correct/incorrect
- else
- set the membernum of sprite gRightTag to the number of member (gLangSelect&" incorrect")
- end if
- set gAnswerRight = 0
- end if
- -- tracking
- TrackAnswer gAnswerRight, getAT(gAnswerLst,gAnswerSpt), getAT(gAnswerLst,foo)
- doFeedBack -- bear feedback: oral and animated
- end if
- end enterAnswer
-
-
-
- on resetQwest
- global gAnswerLinesBox,gfstLftArr,gLstRtArr,gClickNote,gBridgeParts, gRightTag,gWhichBridge,gBridgeLst,gEyeSprite, gSwitchSpt
- set gAnswered = 0
- -- stop talking/idling
- clearSndList
- clearAnimalist
- if gBridgeParts <> 10 then
- set the membernum of sprite gAnswerLinesBox to the number of member "answerarea" -- bring back answer fields
- -- bring back arrows
- repeat with x = gfstLftArr to gLstRtArr
- if x <> gfstLftArr + 1 and x <> gfstLftArr + 4 and x <> gfstLftArr + 7 and x <> gfstLftArr + 10 then
- put the name of member the memberNum of sprite x of castLib "quiz" into foo
- put "up" into word (the number of words in foo) of foo
- set the memberNum of sprite x to the number of member foo
- end if
- end repeat
- set the memberNum of sprite gEyeSprite to the number of member ("eye up")
- set the memberNum of sprite gSwitchSpt to the number of member ("switch up")
- -- click to continue
- set the membernum of sprite gClickNote to the number of member "click gray"
- set the memberNum of sprite gRightTag to the number of member ("e 2 correct") -- correct/incorrect
- putUpQuestion -- feed next question
- else
- if getPos(gBridgeLst,gWhichBridge) = 0 then
- add(gBridgeLst,gWhichBridge)
- end if
- viewBridge
- end if
- end resetQwest
-
-
-
- ------------------------------------------------ Q&A choices ------------------------------------------
- on setLangSelect whichBtn
- global gLangSelect,gLangName,gLangDirect
- put the name of member the memberNum of sprite whichBtn of castLib "chooser" into foo
- set gLangSelect = word 1 of foo
- case gLangSelect of
- "g": set gLangName = "German"
- "i": set gLangName = "Italian"
- "s": set gLangName = "Spanish"
- "f": set gLangName = "French"
- "L": set gLangName = "Latin"
- "P": set gLangName = "Portuguese"
- end case
- if gLangDirect = 1 then
- put ("English to "&gLangName) into field "direction"
- else
- put (gLangName&" to English") into field "direction"
- end if
- end setLangSelect
-
- on switchLangDir
- global gLangDirect,gLangName
- if the frameLabel = "find" then -- clear all fields!
- put "" into field "possWords"
- put "" into field "wordFound"
- put "" into field "wordFind"
- end if
- if gLangDirect = 1 then
- set gLangDirect = 0
- put (gLangName&" to English") into field "direction"
- else
- set gLangDirect = 1
- put ("English to "&gLangName) into field "direction"
- end if
- if the framelabel = "quiz" then
- putUpQuestion
- else if the frameLabel = "find" then
- prepWdFind
- else if the frameLabel = "chooser" then
- prepChooser
- end if
- end switchLangDir
-
- on chooseQuestionNum
- global gWhichQuest,gPastQwestLst,gCat
- set gWhichQuest = VOID
- repeat while gWhichQuest = VOID
- set whichQwest = random(the number of lines in field ("e "&gCat))
- if getPOs(gPastQwestLst,whichQwest) = 0 then
- add(gPastQwestLst,whichQwest)
- set gWhichQuest = whichQwest
- end if
- end repeat
- if count(gPastQwestLst) >= 8 then
- deleteAt(gPastQwestLst,1)
- end if
- end chooseQuestionNum
-
-
- on findgCat
- global gCatTitle,gCat
- if gCatTitle = "allw" then
- set fooNum = random(27)
- else if gCatTitle = "all" then
- set fooNum = random(31)
- end if
- case fooNum of
- "1":set gCat = "rltv"
- "2":set gCat = "advb"
- "3":set gCat = "adjv"
- "4":set gCat = "verb"
- "5":set gCat = "schl"
- "6":set gCat = "tran"
- "7":set gCat = "colr"
- "8":set gCat = "dirc"
- "9":set gCat = "spor"
- "10":set gCat = "occp"
- "11":set gCat = "anml"
- "12":set gCat = "food"
- "13":set gCat = "trvl"
- "14":set gCat = "body"
- "15":set gCat = "buil"
- "16":set gCat = "city"
- "17":set gCat = "hous"
- "18":set gCat = "furn"
- "19":set gCat = "weat"
- "20":set gCat = "conj"
- "21":set gCat = "numb"
- "22":set gCat = "bath"
- "23":set gCat = "kitc"
- "24":set gCat = "time"
- "25":set gCat = "geog"
- "26":set gCat = "clth"
- "27":set gCat = "stor"
- "28","30":set gCat = "tphr"
- "29","31":set gCat = "mphr"
- end case
- return foo
- end findgCat